package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.Result;
import com.itheima.service.OrderListService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/order")
public class OrderListController {

    @Reference
    private OrderListService orderListService;

    @RequestMapping("/add")
    public Result add(@RequestBody Map map,Integer[] setmealIds) {
        try {
            orderListService.add(map,setmealIds);
        } catch (Exception e) {

            e.printStackTrace();
            return new Result(false, "新增预约失败");

        }

        return new Result(true, "新增预约成功");
    }


}